package cn.linran.feign;

import cn.linran.domain.User;
import cn.linran.fallback.UserFeignClientFallbackFactory;
import cn.linran.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @BelongsProject: springcloudalibaba-parent
 * @BelongsPackage: cn.itsource.controller.feigenClients
 * @Author: Director
 * @CreateTime: 2022-07-30  19:04
 * @Description: User服务feign接口
 * @Version: 1.0
 */
@FeignClient(value = "service-muser", fallbackFactory = UserFeignClientFallbackFactory.class) // 表示是feign接口
public interface UserFeignClient {

    /**
     * movie保存和修改公用的user
     */
    @RequestMapping(value="/user/save",method= RequestMethod.POST)
    public JSONResult saveOrUpdate(@RequestBody User user);

    /**
     * movie调用写死的id查询用户信息
     */
    @RequestMapping(value = "/user/{id}",method = RequestMethod.GET)
    JSONResult get(@PathVariable("id")Long id);

}